//
//  ZH_RefundTopTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/31.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_RefundTopTableViewCell.h"
@interface ZH_RefundTopTableViewCell()
@property (nonatomic,weak)UIImageView *photoImage;
@property (nonatomic,weak)UILabel *titleLabel;
@property (nonatomic,weak)UILabel *typeLabel;
@property (nonatomic,weak)UILabel *timeLabel;
@end
@implementation ZH_RefundTopTableViewCell

+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_RefundTopTableViewCell";
    ZH_RefundTopTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_RefundTopTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
- (void)initDefault{
    [self unShowClickEffect];
}
- (void)loadSubviewConstraints{
    [self.photoImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(10));
        make.left.equalTo(self.contentView).offset(FITSCALE(10));
        make.bottom.equalTo(self.contentView).offset(FITSCALE(-10));
        make.width.mas_equalTo(FITSCALE(82));
        make.height.mas_equalTo(FITSCALE(82));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(16));
        make.left.equalTo(self.photoImage.mas_right).offset(FITSCALE(12));
        make.right.equalTo(self.contentView).offset(FITSCALE(-12));
    }];
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleLabel.mas_bottom).offset(FITSCALE(10));
        make.left.equalTo(self.titleLabel);
        make.right.equalTo(self.titleLabel);
    }];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.typeLabel.mas_bottom).offset(FITSCALE(24));
        make.left.equalTo(self.titleLabel);
        make.right.equalTo(self.titleLabel);
    }];
}
#pragma mark - getter,setter
- (UIImageView *)photoImage{
    if (!_photoImage) {
        UIImageView *image = [UIImageView createImageViewWithName:@""];
        image.backgroundColor = kFontColorRed;
        [self.contentView addSubview:_photoImage = image];
    }
    return _photoImage;
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [UILabel createLabelWithText:@"商品名称..." font:kFontSize_28];
        [self.contentView addSubview:_titleLabel = label];
    }
    return _titleLabel;
}
- (UILabel *)typeLabel{
    if (!_typeLabel) {
        UILabel *label = [UILabel createLabelWithText:@"颜色: 白色    尺寸: s码" font:kFontSize_24];
        label.textColor = [UIColor colorWithHexString:@"#999999"];
        [self.contentView addSubview:_typeLabel = label];
    }
    return _typeLabel;
}
- (UILabel *)timeLabel{
    if (!_timeLabel) {
        UILabel *label = [UILabel createLabelWithText:@"购买时间: 2018-08-31" font:kFontSize_24];
        label.textColor = [UIColor colorWithHexString:@"#999999"];
        [self.contentView addSubview:_timeLabel = label];
    }
    return _timeLabel;
}
@end
